{extend name="$base" /}
{block name="resources"}
<style  type="text/css">
.modal-div{
	width:90%;
	margin:auto;
}
.modal-dl{
	overflow:hidden;
}
.modal-dl dt{
	line-height:33px;
	float:left;
	font-weight:normal;
}
.modal-dl dd{
	float:left;
}
.modal-dl dd span{
	display:block;
	color:#de533c;
}
.btn.off{
	background-color:#e26f6f;
	color:#FFF;
}
.btn.sure{
	color:#FFF;
	background-color:#62c462;
}
.color-red{
	color:#f85606;
}
.color-green{
	color:#22c522;
}
.color-blue{
	color:#27a9e3;
}
.text-danger {
    color: #fb6b5b;
}
</style>
{/block}
{block name="right_tab"}{/block}
{block name="thirdmenu"}
	<nav class="ns-third-menu">
		<ul>
			<li class="selected" onclick="location.href='{:__URL('__URL__/nsfx/ADMIN_MODULE/'.$child_menu['url'])}';">{$type_name}明细</li>
		</ul>
	</nav>
{/block}
{block name="main"}
<div class="mod-table">
	<div class="mod-table-head">
		<div class="con style0list">
			<table class="table-class">
				<colgroup>
					<col style="width: 9%;">
					<col style="width: 9%;">
					<col style="width: 9%;">
					<col style="width: 9%;">
					<col style="width: 9%;">
					<col style="width: 9%;">
					<col style="width: 10%;">
					<col style="width: 9%;">
					<col style="width: 10%;">
					<col style="width: 18%;">
				</colgroup>
				<thead>
					<tr>
						<th>用户名称</th>						
						<th>金额类型</th>
						<th>商品卖价</th>
						<th>商品成本</th>								
						<th>商品利润</th>
						<th>商品分销比率</th>
						<th>分销商分佣比率</th>
						<th>佣金金额</th>								
						<th>发放状态</th>						
						<th>时间</th>
					</tr>
				</thead>

				<tbody>

				</tbody>
			</table>
		</div>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
//查询
function searchData(){
	LoadingInfo(1);
}
//加载数据
function LoadingInfo(pageIndex) {
	$.ajax({
		type : "post",
		url : "{:__URL('__URL__/nsfx/ADMIN_MODULE/Commission/userAccountRecordsDetail')}",
		data : {"pageIndex" : pageIndex, "type_id":{$type_id}, "uid":{$uid}},
		success : function(data) {
// 				 alert(JSON.stringify(data));
			$("#page_count").val(data["page_count"]);
			$("#total_count").val(data["total_count"]);
			$("#pageNumber a").remove();
			var html = '';
			
			if (data["data"].length > 0) {
				
				for (var i = 0; i < data["data"].length; i++) {
					html += '<tr align="center">';
					html += '<td>' + data["data"][i]['userinfo']["nick_name"]+ '<br> ' + data["data"][i]['prometerinfo']["promoter_no"]+ '</td>';
					html += '<td>' + data["data"][i]["type_name"]+ '</td>';
					
					html += '<td>' + data["data"][i]['account_info']["goods_money"]+ '</td>';
					html += '<td>' + data["data"][i]['account_info']["goods_cost"]+ '</td>';
					html += '<td>' + data["data"][i]['account_info']["goods_return"]+ '</td>';
					html += '<td>' + data["data"][i]['account_info']["goods_commission_rate"]+ ' %</td>';
					html += '<td>' + data["data"][i]['account_info']["commission_rate"]+ ' %</td>';
					html += '<td>' + parseFloat(data["data"][i]["money"]).toFixed(2) + '</td>';
					
					if(data["data"][i]['account_info']["is_issue"] == 1)
					{
						html += '<td>已发放</td>';
					}
					else
					{
						html += '<td>已发放</td>';
					}
					
					html += '<td>' + timeStampTurnTime(data["data"][i]["create_time"]) + '</td>';
					html += '</tr>';
				}
			} else {
				html += '<tr align="center"><td colspan="10">暂无符合条件的数据记录</td></tr>';
			}
			
			$(".style0list tbody").html(html);
			var totalpage = $("#page_count").val();
			if (totalpage == 1) {
				changeClass("all");
			}
			initPageData(data["page_count"],data['data'].length,data['total_count']);
			var $html = pagenumShow(jumpNumber,totalpage,{$pageshow});
			$("#pageNumber").append($html);
		}
	});
}
</script>
{/block}